﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Web;

namespace ServiceLayer
{
    [DataContract]
    public class CarStateDTO
    {
        [DataMember]
        public int CarId { set; get; }

        [DataMember]
        public PointDTO Location { set; get; }

        [DataMember]
        public double Speed { set; get; }

        [DataMember]
        public double OilPressure { set; get; }

        [DataMember]
        public double GasPressure { set; get; }

        [DataMember]
        public DateTime Time { set; get; }

        [DataMember]
        public double Direction { set; get; }

        internal CarStateDTO(BusinessLayer.CarState carState)
        {
            CarId = carState.CarId;
            Location = new PointDTO(carState.Location);
            Speed = carState.Speed;
            OilPressure = carState.OilPressure;
            GasPressure = carState.GasPressure;
            Time = carState.Time;
            Direction = carState.Direction;
        }
    }
}